package com.aspose.cells.b.a.b;

import com.aspose.cells.Color;
import java.awt.BasicStroke;
import java.awt.Stroke;

public class zm {
   private static float[] b = new float[0];
   private static float[] c = new float[]{3.0F, 1.0F};
   private static float[] d = new float[]{1.0F, 1.0F};
   private static float[] e = new float[]{3.0F, 1.0F, 1.0F, 1.0F};
   private static float[] f = new float[]{3.0F, 1.0F, 1.0F, 1.0F, 1.0F, 1.0F};
   private zc g;
   private int h;
   private int i;
   private int j;
   private int k;
   private int l;
   private int m;
   private com.aspose.cells.b.a.b.a.zi n;
   private float o;
   private float p;
   private float[] q;
   float[] a;
   private float r;
   private com.aspose.cells.b.a.b.a.zd s;
   private com.aspose.cells.b.a.b.a.zd t;

   public zm(zc var1) {
      this(var1, 1.0F);
   }

   public zm(Color var1) {
      this(var1, 1.0F);
   }

   public zm(Color var1, float var2) {
      this((zc)(new zu(var1)), var2);
   }

   public zm(zc var1, float var2) {
      this.g = (zc)var1.e();
      this.o = var2;
      this.h = 0;
      this.j = 0;
      this.i = 0;
      this.k = 0;
      this.m = 0;
      this.l = 0;
      this.r = 10.0F;
      this.n = new com.aspose.cells.b.a.b.a.zi();
      this.q = b;
   }

   public void a() {
   }

   public zc b() {
      return this.g;
   }

   public Color c() {
      if (this.g instanceof zu) {
         return ((zu)this.g).a();
      } else {
         return this.g instanceof com.aspose.cells.b.a.b.a.zh ? ((com.aspose.cells.b.a.b.a.zh)this.g).c() : Color.getEmpty();
      }
   }

   public int d() {
      return this.i;
   }

   public void a(int var1) {
      this.i = var1;
   }

   public float e() {
      return this.p;
   }

   public void a(float var1) {
      this.p = var1;
   }

   public float[] f() {
      return this.q;
   }

   public void a(float[] var1) {
      this.q = var1;
      this.h = this.q == null ? 0 : 5;
   }

   public int g() {
      return this.h;
   }

   public void b(int var1) {
      this.h = var1;
      switch(var1) {
      case 0:
         this.q = b;
         break;
      case 1:
         this.q = c;
         break;
      case 2:
         this.q = d;
         break;
      case 3:
         this.q = e;
         break;
      case 4:
         this.q = f;
         break;
      default:
         this.q = b;
      }

   }

   public int h() {
      return this.j;
   }

   public void c(int var1) {
      this.j = var1;
   }

   public int i() {
      return this.k;
   }

   public void d(int var1) {
      this.k = var1;
   }

   public int j() {
      return this.l;
   }

   public void e(int var1) {
      this.l = var1;
   }

   public float k() {
      return this.r;
   }

   public void b(float[] var1) {
      this.a = var1;
   }

   public float[] l() {
      return this.a;
   }

   public com.aspose.cells.b.a.b.a.zd m() {
      return this.s;
   }

   public void a(com.aspose.cells.b.a.b.a.zd var1) {
      this.s = var1;
      this.j = 255;
   }

   public com.aspose.cells.b.a.b.a.zd n() {
      return this.t;
   }

   public void b(com.aspose.cells.b.a.b.a.zd var1) {
      this.t = var1;
      this.k = 255;
   }

   public int o() {
      if (this.g instanceof zu) {
         return 0;
      } else if (this.g instanceof com.aspose.cells.b.a.b.a.zh) {
         return 4;
      } else if (this.g instanceof zx) {
         return 2;
      } else if (this.g instanceof com.aspose.cells.b.a.b.a.zg) {
         return 1;
      } else {
         throw new IllegalArgumentException("invalid brush");
      }
   }

   public float p() {
      return this.o;
   }

   public void b(float var1) {
      this.o = var1;
   }

   public Object q() {
      zm var1 = new zm((zc)this.g.e(), this.o);
      var1.m = this.m;
      var1.i = this.i;
      var1.p = this.p;
      if (this.q != null) {
         var1.q = com.aspose.cells.b.a.za.a(this.q);
      }

      var1.h = this.h;
      var1.k = this.k;
      var1.l = this.l;
      var1.r = this.r;
      var1.j = this.j;
      if (this.n != null) {
         var1.n = this.n.b();
      }

      return var1;
   }

   public void r() {
      this.a();
   }

   public Stroke s() {
      float[] var1 = null;
      switch(this.h) {
      case 0:
         var1 = b;
         break;
      case 1:
         var1 = c;
         break;
      case 2:
         var1 = d;
         break;
      case 3:
         var1 = e;
         break;
      case 4:
         var1 = f;
         break;
      case 5:
         if (this.q != null) {
            var1 = new float[this.q.length];

            for(int var2 = 0; var2 < this.q.length; ++var2) {
               if (this.k == 0) {
                  var1[var2] = this.q[var2] * this.o;
               } else if ((var2 & 1) == 0) {
                  var1[var2] = this.q[var2] * this.o - this.o;
                  if (this.q[var2] < 0.0F) {
                     var1[var2] = 0.0F;
                  }
               } else {
                  var1[var2] = this.q[var2] * this.o + this.o;
               }
            }
         }
         break;
      default:
         var1 = b;
      }

      byte var4 = 0;
      switch(this.l) {
      case 0:
      case 3:
         var4 = 0;
         break;
      case 1:
         var4 = 2;
         break;
      case 2:
         var4 = 1;
      }

      byte var3 = 1;
      switch(this.k) {
      case 0:
         var3 = 0;
         break;
      case 1:
      case 20:
         var3 = 2;
         break;
      case 2:
      case 18:
         var3 = 1;
      }

      return this.h != 0 ? new BasicStroke(this.o, var3, var4, this.r, var1, 0.0F) : new BasicStroke(this.o, var3, var4, this.r);
   }
}
